package com.lhl.fw.core.exception;

/**
 * @className: BizException
 * @description: TODO 类描述
 * @author: king
 * @date: 2020-07-04 13:52
 **/
public class BizException extends RuntimeException {
    private String code;
    private boolean isShowMsg = true;

    /**
     * 使用枚举传参
     *
     * @param errorCode 异常枚举
     */
    public BizException(CommonErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    /**
     * 使用自定义消息
     *
     * @param code 值
     * @param msg  详情
     */
    public BizException(String code, String msg) {
        super(msg);
        this.code = code;
    }

    /**
     * @param: msg
     * @description: 不定义code，直接使用消息
     * @return:
     * @author: king
     * @date: 2020-11-11
     */
    public BizException(String msg) {
        super(msg);
    }
}
